package com.zdw.oauth.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zdw.oauth.entity.UserRoleEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 用户-角色 Mapper 接口
 * </p>
 *
 * @author 卓德文
 * @since 2023-07-17
 */
public interface UserRoleMapper extends BaseMapper<UserRoleEntity> {

    /**
     * 批量新增用户的角色
     * @param userId
     * @param idList
     * @return
     */
    int saveUserRoleList(@Param("userId") Integer userId, @Param("loginId") Integer loginId, @Param("idList") List<Integer>idList);

    /**
     * 批量删除用户下的角色
     * @param userId
     * @return
     */
    int deleteUserRoleByUserId(@Param("userId") Integer userId);

}
